<template>
  <div
    :class="{
      wrap: true,
      'center-hint': location === 'center',
      'top-hint': location === 'top',
      'bottom-hint': location === 'bottom'
    }"
    v-if="show"
  >
    <div>{{ text }}</div>
    <div>{{ temp1 }}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      temp1: "提示成功"
    };
  }
};
</script>

<style lang="less" scoped>
.wrap {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 10px;
  position: fixed;
  left: 50%;
  border-radius: 10px;
}
.center-hint {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.top-hint {
  top: 5%;
  transform: translate(-50%, 0%);
}
.bottom-hint {
  bottom: 5%;
  transform: translate(-50%, 0%);
}
</style>
